package com.larry.rabbitmq.eighth;

import com.larry.rabbitmq.util.RabbitMQUtils;
import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;

import java.util.HashMap;
import java.util.Map;

/**
 * @author larry
 * @Title: larry-rabbitmq
 * @Package com.larry.rabbitmq.eighth
 * @Description: 死信队列 消费者
 * @date 7/4/212:23 PM
 */
public class Consumer02 {

    //死信队列名称
    public static final String DEAD_QUEUE = "dead_queue";


    public static void main(String args[]) throws Exception{
        Channel channel = RabbitMQUtils.getChannel();

        channel.basicConsume(DEAD_QUEUE,true,(consumerTag, message) -> {
            System.out.println("Consumer02消息: " + new String(message.getBody()));
        },consumerTag -> {});
    }
}
